package com.dream.xiaobo.service;

import com.dream.xiaobo.entity.PageBean;
import com.dream.xiaobo.entity.Product;

import java.lang.reflect.InvocationTargetException;
import java.sql.SQLException;
import java.util.List;


/**
 * @author xiaobo
 * @date 2021/8/31 - 13:25
 */
public interface ProductService {

    /**
     * 分页逻辑接口
     * @param tId
     * @param page
     * @param pageSize
     * @return
     * @throws SQLException
     */
    PageBean<Product> findPage(String tId,Integer page, Integer pageSize) throws SQLException;

    /**
     * 商品信息逻辑接口（根据商品Id）
     * @param pId
     * @return
     * @throws SQLException
     */
    Product findProductByPId(String pId) throws SQLException;

    /**
     * 商品信息逻辑接口（全部）
     * @return
     * @throws SQLException
     * @throws InvocationTargetException
     * @throws IllegalAccessException
     */
    List<Product> findProduct() throws SQLException, InvocationTargetException, IllegalAccessException;

    /**
     * 添加商品接口
     * @param product
     * @throws SQLException
     */
    void insertProduct(Product product) throws SQLException;
}
